home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
pc
/
LOGIC Apple II 5.25" Library - DOS Part 3
/
DOS069.dsk
/
GOLD MINE.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
7KB
|
214 lines
0 TEXT : HOME
1 C = 1000000
2 B = 331.6
3 M$ = "DAVY"
4 R$ = "SEPT. 20, 1979"
10 VTAB 10
20 HTAB 10
30 PRINT "G O L D M I N E"
35 HTAB 10
40 PRINT "- - - - - - - -"
42 PRINT
45 HTAB 10
50 PRINT "BY ROYCE A. JONES"
55 FOR I = 1 TO 1000: NEXT I
60 DIM X(20,30)
70 HOME
75 VTAB 11
80 PRINT "I'VE BEEN A MINER FOR A HEART OF GOLD,"
85 PRINT "AND I'M GETTIN' OLD."
90 PRINT : PRINT "---NEIL YOUNG---"
95 FOR I = 1 TO 2500: NEXT I
100 HOME : VTAB 12
105 INPUT "DO YOU NEED INSTRUCTIONS? ";K$
110 IF LEFT$(K$,1) = "N" THEN 400
120 HOME : VTAB 7
130 PRINT " THROUGHOUT MANKIND'S HISTORY GOLD"
140 PRINT "HAS BEEN A MAGIC METAL. GOLD HAS BEEN"
150 PRINT "PRIZED BY NEARLY EVERY CIVILIZATION."
160 PRINT : PRINT " NOW IS YOUR CHANCE TO HAVE YOUR OWN"
170 PRINT "GOLD MINE. YOU HAVE ONE YEAR TO MINE ALL";
180 PRINT "THE GOLD YOU CAN. THE MOST YOUR MINE IS"
190 PRINT "WORTH IS ONE MILLION DOLLARS! BUT YOU"
200 PRINT "MUST MINE IT. YOUR MINE CONTAINS 100"
210 PRINT "VEINS OF GOLD. EACH VEIN IS WORTH"
220 PRINT "$10,000."
222 VTAB 24: PRINT " << PRESS THE SPACE BAR TO CONTINUE >>";
224 IF PEEK( -16384) <127 THEN 224
226 POKE -16368,0
228 HOME : VTAB 6
230 PRINT : PRINT " TO START WITH YOUR MINE HAS JUST ONE"
240 PRINT "VERTICAL SHAFT. YOU MUST ENLARGE ON THIS";
250 PRINT "BY MINING. IT TAKES ONE DAY TO MINE ONE"
260 PRINT "POSITION, WHETHER IT CONTAINS ORE OR"
270 PRINT "NOT. IF THE POSITIONS HAVE ALREADY BEEN"
280 PRINT "MINED YOU CAN MOVE FIVE POSITIONS IN ONE";
290 PRINT "DAY. YOU CAN MOVE IN FOUR DIRECTIONS:"
300 PRINT "UP, DOWN, LEFT, AND RIGHT. TO MOVE TYPE"
310 PRINT "THE FIRST LETTER OF THE DIRECTION YOU"
315 PRINT "WISH TO MOVE AND THEN THE NUMBER OF"
320 PRINT "POSITIONS TO MOVE. FOR EXAMPLE, TWO"
325 PRINT "POSITIONS UP WOULD BE U2, 3 POSITIONS"
330 PRINT "RIGHT WOULD BE R3, AND SO ON."
332 VTAB 24: PRINT " << PRESS THE SPACE BAR TO CONTINUE >>";
333 IF PEEK( -16384) <127 THEN 333
334 POKE -16368,0: HOME : VTAB 6
335 PRINT : PRINT " YOU CAN MOVE AS MANY POSITIONS AS YOU";
340 PRINT "WANT IN ONE DIRECTION EXCEPT THAT YOU"
345 PRINT "CANNOT GO PAST THE BORDER OF THE MINE."
350 PRINT "IF YOU TRY TO YOU WILL BE STOPPED AT THE";
355 PRINT "BORDER. YOU CAN THEN MOVE FROM THERE ON"
360 PRINT "YOUR NEXT TURN."
365 PRINT : PRINT " EACH MOVE TAKES ONE DAY. ON THE MAP"
370 PRINT "EACH LEVEL IN THE MINE IS A DIFFERENT"
375 PRINT "LETTER, (A-L, AND N-U). YOU ARE THE"
380 PRINT "MINER AND ARE REPRESENTED BY THE LETTER"
382 PRINT "M. ALL GOLD VEINS ARE SHOWN AS '*'."
384 PRINT "YOU BEGIN AT THE TOP OF THE SHAFT."
386 VTAB 24: PRINT " << PRESS THE SPACE BAR TO CONTINUE >>";
388 IF PEEK( -16384) <127 THEN 388
390 POKE -16368,0
392 HOME
394 VTAB 12: PRINT "GOOD LUCK AND GOOD MINING"
400 TEXT : FOR AA = 1 TO 20: FOR BB = 1 TO 30:X(AA,BB) = 0: NEXT BB,AA
410 D = 0:M = 0
420 K$ = "UDLR"
430 L$ = "ABCDEFGHIJKLNOPQRSTU"
440 FOR T = 1 TO 20
450 :::X(T,16) = 1
460 NEXT T
470 :::X(1,16) = 3
480 :::X1 = 16
490 :::Y1 = 1
500 FOR T = 1 TO 100
510 :::Y = INT( RND(1) *20 +1)
520 :::X = INT( RND(1) *30 +1)
530 : IF X = 16 THEN 520
540 :: IF X(Y,X) >0 THEN 510
550 :::X(Y,X) = 2
560 NEXT T
580 POKE 34,1
590 HOME
600 FOR T = 1 TO 20
610 FOR T1 = 1 TO 30
620 ON X(T,T1) +1 GOTO 680,630,650,670
630 HTAB T1: PRINT MID$ (L$,T,1);
640 GOTO 680
650 HTAB T1: PRINT "*";
660 GOTO 680
670 HTAB T1: INVERSE : PRINT "M";: NORMAL
680 NEXT T1
690 PRINT : NEXT T
700 GOSUB 1580
710 POKE 34,21: HOME
720 PRINT " MOVE: ";
730 INPUT A$
760 FOR T1 = 1 TO 4
770 IF MID$ (K$,T1,1) = LEFT$(A$,1) THEN 810
780 NEXT T1
782 HOME : PRINT "<CTRL-G>TYPE D, L, R, OR U FOLLOWED BY A NUMBER"
784 FOR I = 1 TO 1500: NEXT I
786 GOTO 700
790 HOME : PRINT "<CTRL-G>BOUNDRY REACHED"
795 FOR I = 1 TO 1000: NEXT I
800 GOTO 700
810 N = VAL( MID$ (A$,2,3))
820 X9 = X1
830 Y9 = Y1
840 Z$ = MID$ (L$,Y9,1)
845 FOR X = 1 TO N
850 ON T1 GOTO 860,900,960,1020
860 Y1 = Y1 -1
865 IF Y1 >0 THEN 880
870 Y1 = Y1 +1
875 GOTO 790
880 X(Y1 +1,X1) = 1
890 GOTO 1070
900 Y1 = Y1 +1
910 IF Y1 <21 THEN 940
920 Y1 = Y1 -1
930 GOTO 790
940 X(Y1 -1,X1) = 1
950 GOTO 1070
960 X1 = X1 -1
970 IF X1 >0 THEN 1000
980 X1 = X1 +1
990 GOTO 790
1000 X(Y1,X1 +1) = 1
1010 GOTO 1070
1020 X1 = X1 +1
1030 IF X1 <31 THEN 1060
1040 X1 = X1 -1
1050 GOTO 790
1060 X(Y1,X1 -1) = 1
1070 IF X(Y1,X1) = 1 THEN 1140
1080 D = D +1
1085 D = INT(D *10 +.5)/10
1090 IF D >365.24 THEN 1210
1100 IF X(Y1,X1) = 0 THEN 1160
1110 M = M +10000
1120 IF M = 1000000 THEN 1450
1130 GOTO 1160
1140 D = D +.2
1145 D = INT(D *10 +.5)/10
1150 IF D >365.24 THEN 1210
1160 X(Y1,X1) = 3
1165 VTAB Y9 +1: HTAB X9: PRINT Z$
1170 X9 = X1
1175 Y9 = Y1
1180 Z$ = MID$ (L$,Y9,1)
1185 VTAB Y9 +1: HTAB X9: INVERSE : PRINT "M": NORMAL
1190 GOSUB 1580
1195 NEXT X
1200 D = D +1
1202 D = INT(D *10 +.5)/10
1205 IF D <365.24 THEN GOTO 700
1210 GOSUB 1580
1215 HOME
1220 PRINT "<CTRL-G>YOUR YEAR IS UP AND YOU HAVE MINED $";M;" OF GOLD."
1225 FOR I = 1 TO 2000: NEXT I
1228 TEXT : HOME : VTAB 8
1230 REM DISK COMMAND TO OPEN "GOLD.DAT" AS FILE
1240 GOSUB 1530
1250 IF C >M THEN 1400
1260 IF C = M THEN 1380
1270 D = 365.24
1290 REM ROUTINE TO READ CLOCK AND DATE
1300 INPUT "HEY OLD TIMER,<CTRL-A><CTRL-A> WHAT'S YOUR NAME";N$
1305 PRINT : PRINT : PRINT
1310 REM DISK COMMAND TO OPEN "GOLD.DAT" AS FILE #1
1320 REM WRITE N$
1330 REM WRITE D
1340 REM WRITE M
1350 REM WRITE T$
1360 REM CLOSE 1
1370 PRINT "WELL ";N$;" YOU JUST BROKE";
1375 GOTO 1410
1380 PRINT "CONGRATULATIONS!!! YOU TIED";
1390 GOTO 1410
1400 PRINT "YOU DIDN'T BREAK";
1410 PRINT " THE RECORD"
1412 PRINT
1415 PRINT "OF $";C;" MINED IN ";B;" DAYS"
1418 PRINT
1420 PRINT "BY ";M$;" ON ";R$
1425 FOR I = 1 TO 1500: NEXT I
1430 GOTO 1600
1450 FOR I = 1 TO 1000: NEXT I: TEXT : HOME
1455 PRINT "<CTRL-G>CONGRATULATIONS !!<CTRL-G> YOU HAVE MINED A MILLION DOLLARS IN ONLY ";D;" DAYS!<CTRL-G>"
1458 PRINT : PRINT
1460 REM OPEN DISK FILE #2
1470 GOSUB 1530
1480 IF B <D THEN 1400
1490 IF B = D THEN 1380
1500 GOTO 1290
1530 REM ROUTINE TO INPUT M$,B$,C$,R$,B,AND C TO FILE 2 AND THEN CLOSE IT
1570 RETURN
1580 VTAB 1: HTAB 4: PRINT "DAY ";D;" ";: HTAB 20: PRINT "PROFIT IS ";M;" "
1590 RETURN
1600 FOR I = 1 TO 2000: NEXT I
1620 PRINT : PRINT : PRINT
1630 INPUT "WOULD YOU LIKE TO PLAY AGAIN ";A$
1640 IF LEFT$(A$,1) < >"N" THEN RUN
1650 HOME : VTAB 12
1660 PRINT "WELL THEN, ITS BEEN FUN ";N$